package lumis.util.security.acl.serialization;

import lumis.portal.PortalException;
import lumis.portal.serialization.BaseSerializationContext;
import lumis.portal.serialization.DeserializationContext;
import lumis.portal.serialization.SerializationContext;
import lumis.portal.serialization.SerializationException;
import lumis.portal.serialization.operation.IConfigPersister;
import lumis.util.security.acl.AccessControlList;

/**
 * Manager Interface for Acl serialization
 *
 * @version $Revision: 5552 $ $Date: 2007-01-09 11:26:54 -0200 (Tue, 09 Jan 2007) $
 * @since 4.0.7
 */
public interface IAclSerializationManager extends IConfigPersister
{
	// DESERIALIZATION
	
	/**
	 * Deserialize a {@link AccessControlList} object.
	 * @param deserializationContext
	 * @param accessControlListId
	 * @return
	 * @throws SerializationException
	 */
	public AccessControlList deserializeConfig(DeserializationContext deserializationContext, String accessControlListId) throws SerializationException;

	/**
	 * Deserialize an access control list.
	 * @param deserializationContext
	 * @param accessControlListSerializableConfig
	 * @throws PortalException
	 */
	public void deserialize(DeserializationContext deserializationContext, AccessControlListSerializableConfig accessControlListSerializableConfig) throws PortalException;

	// SERIALIZATION
	
	/**
	 * Serialize an access control list.
	 * @param serializationContext
	 * @param securableId
	 * @return
	 * @throws PortalException
	 */
	public AccessControlListSerializableConfig serialize(SerializationContext serializationContext, String securableId) throws PortalException;

	// GENERAL
	
	/**
	 * Set up a serialization context, defining settings such as class aliases, field aliases, transient fields, omitted collections etc.
	 * @param serializationContext
	 */
	public void setupSerializationContext(BaseSerializationContext serializationContext);
}
